//
//  ScratchableView.h
//  jiugonge
//
//  Created by 江湖 on 2018/5/7.
//  Copyright © 2018年 江湖. All rights reserved.
//
//用法：1先设置属性，2在添加九宫格
#import <UIKit/UIKit.h>
@protocol ScratchableDelegate <NSObject>
//可在此在按钮上修改属性
-(void)scratchableWithview:(UIButton *)botton andindex:(NSInteger)row;
//按钮点击
-(void)scratchableWithSelect:(UIButton *)botton andindex:(NSInteger)row;

@end
@interface ScratchableView : UIView
@property(nonatomic,weak)id <ScratchableDelegate> scratchDelegate;
@property(nonatomic,assign)NSInteger row;//cell数量
@property(nonatomic,assign)NSInteger totalColumns;//行数或列数
@property(nonatomic,assign)NSInteger totalX;//j间隙x
@property(nonatomic,assign)NSInteger totalY;//间隙y
@property(nonatomic,assign)NSInteger cellheight;//间隙y


/**
 设置属性
 
 @param row 数量
 @param cellHeight 高度
 @param totalColumns 行数或列数
 @param totalX x间隙
 @param totalY y间隙
 */
-(void)setRow:(NSInteger)row cellHeight:(CGFloat)cellHeight totalColumns:(NSInteger)totalColumns totalX:(CGFloat)totalX totalY:(CGFloat)totalY;

/**
 添加九宫格

 @param direction 九宫格横向还是纵向
 @return 高度
 */
-(CGFloat)addScratchableLatex:(int)direction;
-(void)relouData;
@end
